/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.meanzoft.m3d.model.m3dmodel;

import org.lwjgl.util.vector.Vector3f;

/**
 *
 * This is used by the Meshes as a container for
 * a group of 3 vertex indexes
 * 
 * @author Meanz
 */
public final class Face {

    private int facePoint1;
    private int facePoint2;
    private int facePoint3;
    private int normalPoint1;
    private int normalPoint2;
    private int normalPoint3;
    private int texPoint1;
    private int texPoint2;
    private int texPoint3;

    public Face() {
        this(0, 0, 0, 0, 0, 0, 0, 0, 0);
    }

    public Face(Vector3f facePointer, Vector3f normalPointer, Vector3f texPointer) {
        this((int) facePointer.x, (int) facePointer.y, (int) facePointer.z,
                normalPointer != null ? (int) normalPointer.x : -1,
                normalPointer != null ? (int) normalPointer.y : -1,
                normalPointer != null ? (int) normalPointer.z : -1,
                texPointer != null ? (int) texPointer.x : -1,
                texPointer != null ? (int) texPointer.y : -1,
                texPointer != null ? (int) texPointer.z : -1);
    }

    public Face(int facePoint1, int facePoint2, int facePoint3,
            int normalPoint1, int normalPoint2, int normalPoint3,
            int texPoint1, int texPoint2, int texPoint3) {
        setFacePoint1(facePoint1);
        setFacePoint2(facePoint2);
        setFacePoint3(facePoint3);
        setNormalPoint1(normalPoint1);
        setNormalPoint2(normalPoint2);
        setNormalPoint3(normalPoint3);
        setTexPoint1(texPoint1);
        setTexPoint2(texPoint2);
        setTexPoint3(texPoint3);
    }

    /**
     * Getters and Setters
     */
    public int getFacePoint1() {
        return facePoint1;
    }

    public void setFacePoint1(int facePoint1) {
        this.facePoint1 = facePoint1;
    }

    public int getFacePoint2() {
        return facePoint2;
    }

    public void setFacePoint2(int facePoint2) {
        this.facePoint2 = facePoint2;
    }

    public int getFacePoint3() {
        return facePoint3;
    }

    public void setFacePoint3(int facePoint3) {
        this.facePoint3 = facePoint3;
    }

    public int getNormalPoint1() {
        return normalPoint1;
    }

    public void setNormalPoint1(int normalPoint1) {
        this.normalPoint1 = normalPoint1;
    }

    public int getNormalPoint2() {
        return normalPoint2;
    }

    public void setNormalPoint2(int normalPoint2) {
        this.normalPoint2 = normalPoint2;
    }

    public int getNormalPoint3() {
        return normalPoint3;
    }

    public void setNormalPoint3(int normalPoint3) {
        this.normalPoint3 = normalPoint3;
    }

    public int getTexPoint1() {
        return texPoint1;
    }

    public void setTexPoint1(int texPoint1) {
        this.texPoint1 = texPoint1;
    }

    public int getTexPoint2() {
        return texPoint2;
    }

    public void setTexPoint2(int texPoint2) {
        this.texPoint2 = texPoint2;
    }

    public int getTexPoint3() {
        return texPoint3;
    }

    public void setTexPoint3(int texPoint3) {
        this.texPoint3 = texPoint3;
    }
}
